home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Stuff / 3D_Reality / Shaders / Shader_Source / SD_Simple_tx.sl < prev    next >
Encoding:
Text File  |  1992-07-25  |  906 b   |  35 lines

  1. /*************************************************************************
  2. *    Copyright (c) 1989-1992 Stone Design Corp.  All rights reserved. 
  3. *    programmer:    Bill Bumgarner
  4. *    File name:    SD_Simple_tx.sl
  5. *    Date:        Jul 21 1992 
  6. *    Purpose:    Map a texture to a surface in a simple fashion.  Does
  7.             not do lighting, so all surfaces will come out with the 
  8.             texture's colors at full intensity.
  9.  
  10.     Variables:
  11.         s_frequency:    # of times to repeat texture in the s direction
  12.         t_frequency:    # of times to repeat texture in the t direction
  13.         txmap:        full path to the texture map file
  14. ***************************************************************************/
  15.  
  16. surface SD_Simple_tx(
  17.  
  18.     float     s_frequency     = 1.,
  19.         t_frequency     = 1.;
  20.  
  21.     string    txmap        = "";
  22.  
  23. )
  24. {
  25.     float ss = s_frequency * s;
  26.     float tt = t_frequency * t;
  27.     
  28.  
  29.     if(txmap != ""){
  30.         Ci = color texture(txmap, ss, tt);
  31.     } else {
  32.         Ci = Cs;
  33.     }
  34.     Oi = Os;
  35. }